package cn.rkylin.oms.warehouseDocking.dao.qimen;

import cn.rkylin.core.IDataBaseFactory;
import cn.rkylin.oms.warehouseDocking.vo.qimen.StockInCreate;
import cn.rkylin.oms.warehouseDocking.vo.qimen.StockInSkuCreate;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 奇门入库单创建数据访问层具体实现
 * 
 * @author fengwang
 * @created 2017年11月7日
 */

@Repository(value = "iStockInCreateDAO")
public class StockInCreateDAOImpl implements IStockInCreateDAO {

    @Autowired
    protected IDataBaseFactory dao;

    private static final String selectInfoStockInIdByPrjIdAndStorId = "selectInfoStockInIdByPrjIdAndStorId";

    private static final String selectInfoStockInByPrjIdAndStorId = "selectInfoStockInByPrjIdAndStorId";

    private static final String selectInfoStockInSkuByStockId = "selectInfoStockInSkuByStockId";

    @Override
    public List<StockInCreate> selectInfoStockInIdByPrjIdAndStorId(Map<String, Object> reqMap) throws Exception {
        List<StockInCreate> rList = dao.findAllList(selectInfoStockInIdByPrjIdAndStorId, reqMap);
        return rList;
    }

    @Override
    public StockInCreate selectInfoStockInByPrjIdAndStorId(Map<String, Object> reqMap) throws Exception {
        StockInCreate rList = (StockInCreate)dao.findForObject(selectInfoStockInByPrjIdAndStorId, reqMap);
        return rList;
    }

    @Override
    public List<StockInSkuCreate> selectInfoStockInSkuByStockId(Map<String, Object> reqMap) throws Exception {
        List<StockInSkuCreate> rList = dao.findAllList(selectInfoStockInSkuByStockId, reqMap);
        return rList;
    }

}
